package com.yl.chainStore.mapper.pay

import com.yl.chainStore.entity.pay.PayOrderDetailRefundLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Param

/**
 * <p>
 * 订单明细退款记录 Mapper 接口
 * </p>
 *
 * @author cxw
 * @since 2021-11-08
 */
@Mapper
interface PayOrderDetailRefundLogMapper : BaseMapper<PayOrderDetailRefundLog>{

	/**
	 * 查询订单明细中已退数量
	 */
	fun selectRefundSumCountByDetailId(detailId:Long):Int

	/**
	 * 查询订单明细中已退金额
	 */
	fun selectRefundSumMoneyByDetailId(detailId:Long):Long

	/**
	 * 查询订单中已经被退款的总额
	 */
	fun getOrderRefundSumMoneyByOrderId(@Param("orderId")orderId:Long):Long
}
